package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.UserBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface IUserMapper extends BaseMapper<UserBean> {

    public void add(@Param("userId") Integer userId,
                    @Param("roleIdArray") Integer[] roleIdArray);

    @Delete("DELETE FROM t_user_role WHERE fk_userId=#{id};" +
            "DELETE FROM t_user WHERE pk_userId=#{id};")
    public void del(Integer userId);

    public void updateRole(@Param("userId") Integer userId,
                           @Param("roleIdArray") Integer[] roleIdArray);
}
